﻿#region Using Directives

    using System;
    using Csla;

#endregion

namespace MarketPulse.BusinessLogic.Core.System
{
    /// <summary>
    /// This class represents a profile within the system. A profile allows a user to log in to a specific interface, each of the interfaces that make up the 
    /// client, shopper and internal applications used by the business each have a profile. Whilst the actual login details belong to a user, the profile holds application specific details.
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.ContactDetailsFactory, MarketPulse.DataAccess.Factory")]
    public class ContactDetails : MarketPulseBase<ContactDetails>
    {

        #region Constructors

            /// <summary>
            /// default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
        private ContactDetails()
        {
        }

        #endregion

        #region Methods

            #region Factory Methods

                /// <summary>
                /// Method that creates a new Profile via the DataPortal client proxy
                /// </summary>
                /// <returns>The newly created User object</returns>
                public static ContactDetails New()
                {
                    return DataPortal.Create<ContactDetails>();
                }

                /// <summary>
                /// Method that gets the specified Profile via the DataPortal client proxy 
                /// </summary>
                /// <param name="guid">The guid of the User to retrieve the Contact Details</param>
                /// <returns>The populated ContactDetails object</returns>
                public static ContactDetails GetByUserGUID(Guid guid)
                {
                    return DataPortal.Fetch<ContactDetails>(new Csla.SingleCriteria<Guid>(guid));
                }

            #endregion

        #endregion

        #region Properties

            #region Association GUID Properties (Foreign Keys)

                /// <summary>A guid value representing the country associated with this class</summary>
                public static PropertyInfo<Guid> CountryGUIDProperty = RegisterProperty<Guid>(p => p.CountryGUID);
                /// <summary>A guid value representing the country associated with this class</summary>
                public Guid CountryGUID
                {
                    get { return GetProperty(CountryGUIDProperty); }
                    set { SetProperty(CountryGUIDProperty, value); }
                }

                /// <summary>A guid value representing the area associated with this class</summary>
                public static PropertyInfo<Guid> AreaGUIDProperty = RegisterProperty<Guid>(p => p.AreaGUID);
                /// <summary>A guid value representing the area associated with this class</summary>
                public Guid AreaGUID
                {
                    get { return GetProperty(AreaGUIDProperty); }
                    set { SetProperty(AreaGUIDProperty, value); }
                }

            #endregion

            /// <summary>A string value representing the contact details label</summary>
            public static PropertyInfo<string> ContactDetailsLabelProperty = RegisterProperty<string>(p => p.ContactDetailsLabel);
            /// <summary>A string value representing the contact details label</summary>
            public string ContactDetailsLabel
            {
                get { return GetProperty(ContactDetailsLabelProperty); }
                set { SetProperty(ContactDetailsLabelProperty, value); }
            }

            /// <summary>A string value representing the apartment floor number</summary>
            public static PropertyInfo<string> ApartmentOrFloorNumberProperty = RegisterProperty<string>(p => p.ApartmentOrFloorNumber);
            /// <summary>A string value representing the apartment floor number</summary>
            public string ApartmentOrFloorNumber
            {
                get { return GetProperty(ApartmentOrFloorNumberProperty); }
                set { SetProperty(ApartmentOrFloorNumberProperty, value); }
            }

            /// <summary>A string value representing the house name or number</summary>
            public static PropertyInfo<string> HouseNameOrNumberProperty = RegisterProperty<string>(p => p.HouseNameOrNumber);
            /// <summary>A string value representing the house name or number</summary>
            public string HouseNameOrNumber
            {
                get { return GetProperty(HouseNameOrNumberProperty); }
                set { SetProperty(HouseNameOrNumberProperty, value); }
            }

            /// <summary>A string value representing the address line 1</summary>
            public static PropertyInfo<string> AddressLine1Property = RegisterProperty<string>(p => p.AddressLine1);
            /// <summary>A string value representing the address line 1</summary>
            public string AddressLine1
            {
                get { return GetProperty(AddressLine1Property); }
                set { SetProperty(AddressLine1Property, value); }
            }

            /// <summary>A string value representing the address line 2</summary>
            public static PropertyInfo<string> AddressLine2Property = RegisterProperty<string>(p => p.AddressLine2);
            /// <summary>A string value representing the address line 2</summary>
            public string AddressLine2
            {
                get { return GetProperty(AddressLine2Property); }
                set { SetProperty(AddressLine2Property, value); }
            }

            /// <summary>A string value representing the address line 3</summary>
            public static PropertyInfo<string> AddressLine3Property = RegisterProperty<string>(p => p.AddressLine3);
            /// <summary>A string value representing the address line 3</summary>
            public string AddressLine3
            {
                get { return GetProperty(AddressLine3Property); }
                set { SetProperty(AddressLine3Property, value); }
            }

            /// <summary>A string value representing the address line 4</summary>
            public static PropertyInfo<string> AddressLine4Property = RegisterProperty<string>(p => p.AddressLine4);
            /// <summary>A string value representing the address line 4</summary>
            public string AddressLine4
            {
                get { return GetProperty(AddressLine4Property); }
                set { SetProperty(AddressLine4Property, value); }
            }

            /// <summary>A string value representing the address line 5</summary>
            public static PropertyInfo<string> AddressLine5Property = RegisterProperty<string>(p => p.AddressLine5);
            /// <summary>A string value representing the address line 5</summary>
            public string AddressLine5
            {
                get { return GetProperty(AddressLine5Property); }
                set { SetProperty(AddressLine5Property, value); }
            }

            /// <summary>A string value representing the post code</summary>
            public static PropertyInfo<string> PostCodeProperty = RegisterProperty<string>(p => p.PostCode);
            /// <summary>A string value representing the post code</summary>
            public string PostCode
            {
                get { return GetProperty(PostCodeProperty); }
                set { SetProperty(PostCodeProperty, value); }
            }

            /// <summary>A string value representing the phone no</summary>
            public static PropertyInfo<string> PhoneProperty = RegisterProperty<string>(p => p.Phone);
            /// <summary>A string value representing the phone no</summary>
            public string Phone
            {
                get { return GetProperty(PhoneProperty); }
                set { SetProperty(PhoneProperty, value); }
            }

            /// <summary>A float value representing the latitude</summary>
            public static PropertyInfo<float> LatitudeProperty = RegisterProperty<float>(p => p.Latitude);
            /// <summary>A float value representing the latitude</summary>
            public float Latitude
            {
                get { return GetProperty(LatitudeProperty); }
                set { SetProperty(LatitudeProperty, value); }
            }

            /// <summary>A float value representing the longtitude</summary>
            public static PropertyInfo<float> LongtitudeProperty = RegisterProperty<float>(p => p.Longtitude);
            /// <summary>A float value representing the longtitude</summary>
            public float Longtitude
            {
                get { return GetProperty(LongtitudeProperty); }
                set { SetProperty(LongtitudeProperty, value); }
            }

        #endregion

    }
}
